package com.liujing.tacticspatten;

/**
 * @program: DesignPattenDemo
 * @description: 现金收费工厂
 * @author: liujing
 * @create: 2019-11-22 11:08
 **/
public class CashFactory {
    public static CashSuper createCashAccept(String type) {
        CashSuper cashSuper = null;
        switch (type) {
            case "正常收费":
                cashSuper = new CashNormal();
                break;
            case "满300减100":
                cashSuper = new CashReturn(300, 100);
                break;
            case "打8折":
                cashSuper = new CashRebate(0.8);
                break;
            default:
        }
        return cashSuper;
    }
}
